home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / modules / nessus-2.2.8.mo / usr / lib / nessus / plugins / uddi.inc < prev    next >
Text File  |  2005-03-31  |  2KB  |  39 lines

  1. # By John Lampe
  2. # $Id: uddi.inc,v 1.2 2002/10/09 15:17:56 renaud Exp $
  3.  
  4. function create_uddi_xml (ktype,path,key,name) 
  5. {
  6.     envelope_header = string("<?xml version='1.0' encoding='UTF-8'?> <s:Envelope");
  7.     envelope_header = string(envelope_header, " xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body>");
  8.  
  9.     get_servicedetail = string("<get_serviceDetail generic='1.0' xmlns='urn:uddi-org:api'>"); 
  10.     get_servicedetail = string(get_servicedetail, "<serviceKey>", key, "</serviceKey></get_serviceDetail>");
  11.  
  12.     find_business = string("<find_business generic='1.0' xmlns='urn:uddi-org:api'>");
  13.     find_business = string(find_business, "<name>",name,"</name></find_business>");
  14.  
  15.     find_service = string("<find_service generic='1.0' xmlns='urn:uddi-org:api' businessKey='",key, "'>");
  16.     find_service = string(find_service, "<name>", name, "</name></find_service>");
  17.  
  18.     close_envelope = string("</s:Body></s:Envelope>");
  19.  
  20.     if (ktype == "UDDI_QUERY_FBUSINESS")       method = find_business;
  21.     if (ktype == "UDDI_QUERY_FSERVICE")        method = find_service;
  22.     if (ktype == "UDDI_QUERY_GSERVICE_DETAIL") method = get_servicedetail;
  23.  
  24.     xml = string(envelope_header, method, close_envelope);
  25.     len = strlen(xml);
  26.  
  27.     finished_message =  string("POST ", path,  " HTTP/1.0\r\n");
  28.     finished_message =  string(finished_message, "Accept: text/xml\r\n");
  29.     finished_message =  string(finished_message, "Accept: multipart/*\r\n");
  30.     finished_message =  string(finished_message, "Host: ", get_host_ip(), "\r\n");
  31.     finished_message =  string(finished_message, "User-Agent: NESSUS::SOAP\r\n");
  32.     finished_message =  string(finished_message, "Content-Length: ", len, "\r\n");
  33.     finished_message =  string(finished_message, "Content-Type: text/xml; charset=utf-8\r\n"); 
  34.     finished_message =  string(finished_message, "SOAPAction: ''\r\n\r\n", xml);
  35.     return(finished_message);
  36. }
  37.  
  38.  
  39.